var currentIndexTemp = 0;
var indexTemp = 0;
var frame,nf;
efform_onload = function ()
{
	date = date2String();
	$("#inqu_status-0-fdVirtualDate").val(date);
}; 

function date2String(){
    var datetime = new Date();
    var year = datetime.getFullYear();
    var month = datetime.getMonth() + 1 < 10 ? "0" + (datetime.getMonth() + 1) : datetime.getMonth() + 1;
    var date = datetime.getDate() < 10 ? "0" + datetime.getDate() : datetime.getDate();
    return year + "-" + month + "-" + date;
} 

function fundiv(currentIndex,index){  
	currentIndexTemp = currentIndex;
	indexTemp = index;
	date = $("#inqu_status-0-fdVirtualDate").val();
	if(index ==0)
	{  
		var frame = frames[0];
		frame.src = "DispatchAction.do?efFormEname=ZMCI40&querydate="+date;
		efform.setStatus(0, "正在加载...");
	}else if(index ==1)
	{ 
		var frame = frames[1];
		frame.src = "DispatchAction.do?efFormEname=ZMCI41&querydate="+date;
		efform.setStatus(0, "正在加载...");
	}else if(index ==2)
	{ 
		var frame = frames[2];
		frame.src = "DispatchAction.do?efFormEname=ZMCI42&querydate="+date;
		efform.setStatus(0, "正在加载...");
	}else if(index ==3)
	{ 
		var frame = frames[3];
		frame.src = "DispatchAction.do?efFormEname=ZMCI43&querydate="+date;
		efform.setStatus(0, "正在加载...");
	}
};

button_query_onclick = function() {
	frame = 0;
	date = 	$("#inqu_status-0-fdVirtualDate").val();
	if(date == ""){
		date = date2String();
		$("#inqu_status-0-fdVirtualDate").val(date);		
	}
		
	var info = getDetail("ef_region_inqu","inqu_status");
	if (null != info) {
		if (frame.src == "DispatchAction.do?efFormEname=ZMCI40"
				|| indexTemp == '0') {
			fundiv(0, 0);
		}
		if (frame.src == "DispatchAction.do?efFormEname=ZMCI41"
				|| indexTemp == '1') {
			fundiv(1, 1);
		}
		if (frame.src == "DispatchAction.do?efFormEname=ZMCI42"
				|| indexTemp == '2') {
			fundiv(2, 2);
		}
		if (frame.src == "DispatchAction.do?efFormEname=ZMCI43"
				|| indexTemp == '3') {
			fundiv(3, 3);
		}
	} 
};
